<!DOCTYPE html>
<html lang="en">
<head>
    <title>工作报告列表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>

</head>
<style>
    [v-cloak] {
        display: none;
    }

    * {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        font-size: 14px;
    }

    body {
        margin: 0;
        background: #fff;
    }

    .boxBoy {
        background: #fff;
    }

    table {
        border-spacing: 0;
        border-collapse: collapse;
        display: table;
    }

    .weather {
        text-align: center;
        font-size: 16px;
        position: absolute;
        top: 5px;
        line-height: 30px;
        float: left;
    }

    th {
        font-weight: normal;
    }

    table.text-center, table.text-center td, table.text-center th {
        text-align: center;
        font-size: 14px;
        table-layout: fixed;
    }

    .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
        border: 1px solid #cbcbcd;
        height: 28px;
        position: relative;
        padding: 0 4px;
    }

    table th {
        background: #f8f8f8;
    }

    .table-bordered {
        border: 1px solid #cbcbcd;
    }

    .table {
        width: 100%;
        max-width: 100%;
    }

    .hidden {
        display: none;
    }

    .lineOne, .lineTwo {
        text-align: left;
    }

    .tdColor {
        background-color: #f8f8f8;
        font-weight: normal;
        font-size: 12px !important;
        color: #333 !important;
    }

    .lineOne {
        max-height: 24px;
        line-height: 19px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-align: left;
    }

    span {
        font-size: 12px;
    }

    .lineTwo span {
        max-height: 55px;
        line-height: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        text-align: left;
        padding: 5px;

    }

    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }

    .div-td-content-more i {
        width: 15px;
        height: 12px;
        background: url("/dist/img/more-icon.png");
        position: absolute;
        left: 50px;
        top: -12px;
    }

    .clear {
        clear: both
    }

    .boxItem {
        width: 100%;
        margin-top: -1px;
        padding-bottom: 0;
        background: inherit;
        background-color: rgba(255, 255, 255, 1);
        border: none;
        position: relative;
    }

    .boxItemTitle {
        color: #2c8cec;
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 6px;
        text-align: center;
    }

    .home {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 10px;
        height: 14px;
        line-height: 14px;
        text-align: center;
    }

    .dian-icon {
        background: url("/dist/img/dian.png") no-repeat;
        background-size: cover;
        width: 14px;
        height: 14px;
        display: inline-block;
    }

    .jiaobiao, .jiaobiaoNew {
        position: relative;
    }

    .jiaobiao i {
        display: block;
        width: 0;
        height: 0;
        border-width: 0px 0 12px 12px;
        border-style: solid;
        border-color: transparent transparent transparent #2a8cec;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .jiaobiaoNew i {
        display: block;
        width: 12px;
        height: 12px;
        background: url("/dist/img/newLog2.png");
        background-size: 100% 100%;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .lineImg {
        padding-top: 5px !important;
        padding-bottom: 10px !important;
    }

    .lineImg img {
        height: 45px;
        width: 45px;
        float: left;
        margin: 10px;
        object-fit: cover;
    }

    .newCustomer {
        background: url(/dist/img/new.png) no-repeat;
        background-size: cover;
        width: 20px;
        height: 20px;
        right: 0;
        top: 2px;
        position: absolute;
    }

    .wajueji {
        padding-left: 140px;
        background: url("/dist/img/wajueji.png") no-repeat;
        background-size: 120px 88px;
        height: 88px;
        line-height: 88px;
        color: red;
        font-size: 14px;
        font-weight: bold;
        margin-left: 50px;
    }

    .qipao {
        /*background: url(/dist/img/qipao.png);*/
        background-size: 100% 100%;
        height: 88px;
        /* padding: 0 20px; */
        padding-left: 20px;
        /*padding-right: 20px;*/
        color: red;
        line-height: 88px;
        float: left;
        font-size: 14px;
        font-weight: bold;
    }

    .plan1 {
        background: url("/dist/img/plan1.png") no-repeat center center;
        background-size: 100%;
    }

    .plan2 {
        background: url("/dist/img/plan2.png") no-repeat center center;
        background-size: 100%;
    }

    .plan3 {
        background: url("/dist/img/plan3.png") no-repeat center center;
        background-size: 100%;
    }

    .boxItemTitleNotice {
        color: red;
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNotice i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 16px;
        width: 16px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .boxItemTitleNoticeTime {
        color: red;
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNoticeTime i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 16px;
        width: 16px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .search-button {
        width: 14px;
        height: 14px;
        background-image: url(/dist/img/glass.jpg);
        border: 0 none;
        cursor: pointer;
        margin-top: 0px;
    }

    input[type=button] {
        outline: none;
    }

    .oaBtn {
        background: url(/dist/img/btn-bj2.png) repeat-y !important;
        background-size: 100% 100% !important;
        color: #fff !important;
    }

    .btn-group-sm > .btn, .btn-sm {
        padding: 2px 10px;
    }

    .btn {
        border-radius: 3px;
        -webkit-box-shadow: none;
        box-shadow: none;
        border: 1px solid transparent;
    }

    .pull-right {
        float: right !important;
    }

    .blue {
        color: #39c;
    }

    .red {
        color: #e03800;
    }

    .weather img {
        height: 30px;
        width: 30px;
        float: left;
    }

    .btn-blue {
        border: none;
        background: #2a8cec;
        color: #fff;
        font-size: 16px;
        height: 48px;
        width: 100%;
        border-radius: 2px;
        outline: none;
        position: fixed;
        left: 0;
        bottom: 0;
        font-weight: bold;
    }

    .btn-blue:active {
        border: none;
        background: #356698;
        opacity: 0.8;
        color: #fff;
        font-size: 16px;
        height: 48px;
        width: 100%;
        border-radius: 2px;
        outline: none;
        position: fixed;
        left: 0;
        bottom: 0;
        font-weight: bold;
    }

    .btn-blue.focus, .btn-blue:focus, .btn-blue:hover {
        color: #fff;
        text-decoration: none;

    }

    .line {
        border-bottom: 4px solid #2a8cec;
    }

    .templateStyle {
        margin-top: 15px;
        box-shadow: 2px 2px 3px #DDDDDD;
        margin-left: 10px;
        margin-right: 10px;
    }

    .lefts {
        color: #2a8cec;
        font-weight: bold;
    }

    .rights {
        color: #999999;
    }

    .topTip {
        position: fixed;
        top: 0;
        width: 100%;
        height: 30px;
        background: #e1f5fe;
        line-height: 30px;
        padding-left: 22px;
    }

    .outLine {
        border-bottom: none !important;
    }

    .divMore {
        width: 12px;
        height: 12px;
        background-image: url(/dist/img/gengduo.png);
        background-repeat: no-repeat;
        background-size: cover;
        margin: 0 auto;
        position: absolute;
        top: 20px;
        right: 24px;
    }

    .divMore_active {
        width: 12px;
        height: 12px;
        background-image: url(/dist/img/shouqi.png);
        background-repeat: no-repeat;
        background-size: cover;
        margin: 0 auto;
        position: absolute;
        top: 20px;
        right: 24px;
    }

    .fixed-table_header tr th {
        background: #d3e8fd !important;
        color: black !important;
    }

    .hotsearch {
        float: left;
        line-height: 24px;
        margin-right: 30px;
        overflow: hidden;
        text-align: center;
        width: 4em; /*这个值是看最长能显示几个文字，如x，则为x em*/
    }

    .hotsearch td {
        display: block;
    }

    .w2 {
        letter-spacing: 2em; /*如果需要y个字两端对齐，则为(x-y)/(y-1),这里是（4-2）/(2-1)=2em */
        margin-right: -2em; /*同上*/
    }

    .w3 {
        letter-spacing: 0.5em; /*如果需要y个字两端对齐，则为(x-y)/(y-1),这里是（4-3）/(3-1)=0.5em */
        margin-right: -0.5em; /*同上*/
    }
</style>
<body>
<section class="content" id="app" v-cloak style="padding: 0;min-height: 100vh">
    <div class="div-td-content-more"><i></i></div>
    <!--报告列表-->
    <div class="boxItem">
        <div class="boxBoy">
            <table class="table text-center table-width fixed-table_header">
                <tbody>
                <tr style="line-height: 30px;">
                    <th class="tdColor" style="width: 35px;padding-left: 5px;padding-top: 2px;">序号</th>
                    <th class="tdColor" style="width: 60px;padding-top: 2px;">日期</th>
                    <th class="tdColor" style="width: 83px;padding-top: 2px;">提交时间</th>
                    <th class="tdColor" style="width: 45px;padding-top: 2px;">状态</th>
                    <th style="width:60px;padding-top: 2px;" class="tdColor">评论人数</th>
                    <th></th>
                    <th class="tdColor" style="width: 60px;padding-top: 2px;">操作</th>
                </tr>
                <template v-for="(item,i) in list">
                    <tr style="height: 36px;border-bottom: 1px solid #eeeeee;background: #F9F9F9"
                        @click="openDetail(item.id)">
                        <td style="width: 35px;font-size: 12px;padding-left: 5px;">{{i+1}}</td>
                        <td style="font-size: 12px">{{formatDate2(item.reportDate)}}</td>
                        <td style="font-size: 12px;">{{formatDate(item.createTime)}}</td>
                        <td v-if="item.flage == 0"><i class="fa fa-check"
                                                      style="color: rgb(52, 159, 47);"></i></td>
                        <td v-else><i class="fa fa-close" v-if="item.workFlag=='正常出勤'" style="color:red;"></i>
                            <span v-if="item.workFlag=='请假'">请假</span>
                            <span v-if="item.workFlag=='缺勤'">缺勤</span></td>
                        <td style="width:60px;">{{item.commentNum}}</td>
                        <td></td>
                        <td v-if="item.flage == 0">
                            <span style="color: #2a8cec;font-size: 12px">查看</span>
                        </td>
                        <td v-else></td>
                    </tr>
                    <tr v-if="item.commentList.length>0">
                        <td colspan="6" style="padding: 0px">
                            <table style="width: 100%;position: relative;border-bottom: 1px solid #eeeeee"
                                   class="table text-center table-width ">
                                <tr v-for="(item2,j) in item.commentList" v-if="checkMore=='gengduo'&&j<2">
                                    <td style="width: 35px;font-size: 12px"></td>
                                    <td style="width:60px;font-size: 12px" class="outLine">
                                        <span style="text-align: justify;display: inline-block;overflow: hidden;vertical-align: middle;height: 24px;line-height: 24px;width: 40px;">
                                            {{item2.createUserName}}<i
                                                style="display: inline-block;width: 100%;height: 0;"></i>
                                        </span>
                                    </td>
                                    <td style="width:83px;font-size: 12px" class="outLine"><span></span></td>
                                    <!--<td style="width:15%;">{{convertFlage2Name(item.flage)}}</td>-->
                                    <td style="width:45px;font-size: 12px" class="outLine">
                                        <span :style="item2.grade=='合格'?'':'color:red'">{{item2.grade}}</span>
                                    </td>
                                    <td colspan="2" style="font-size: 12px;width: 77px" class="outLine"><span
                                            class="lineOne">{{item2.otherDescription}}</span>
                                    </td>
                                    <td style="width:60px;font-size: 12px" class="outLine">
                                        <div v-if="j==0&&item.commentList.length>2"
                                             :class="checkMore=='gengduo'?'divMore':'divMore_active'"
                                             @click="checkMore1()"></div>
                                    </td>
                                </tr>
                                <tr v-for="(item2,j) in item.commentList" v-if="checkMore=='shouqi'"
                                    style="position: relative;">
                                    <td style="width: 35px;font-size: 12px"></td>
                                    <td style="width:60px;font-size: 12px;" class="outLine">
                                        <span style="text-align: justify;display: inline-block;overflow: hidden;vertical-align: middle;height: 24px;line-height: 24px;width: 40px;">
                                            {{item2.createUserName}}<i
                                                style="display: inline-block;width: 100%;height: 0;"></i>
                                        </span>
                                    </td>
                                    <td style="width:83px;font-size: 12px" class="outLine"><span></span></td>
                                    <!--<td style="width:15%;">{{convertFlage2Name(item.flage)}}</td>-->
                                    <td style="width:45px;font-size: 12px" class="outLine">
                                        <span :style="item2.grade=='合格'?'':'color:red'">{{item2.grade}}</span>
                                    </td>
                                    <td colspan="2" style="font-size: 12px;width: 77px" class="outLine"><span
                                            class="lineOne">{{item2.otherDescription}}</span>
                                    </td>
                                    <td style="width:60px;font-size: 12px" class="outLine">
                                        <div v-if="j==0&&item.commentList.length>2"
                                             :class="checkMore=='gengduo'?'divMore':'divMore_active'"
                                             @click="checkMore1()"></div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </template>
                </tbody>
            </table>
        </div>
    </div>
    <div class="clear"></div>
    <div v-if="returnFlag">
        <div style="margin: 0 auto;color: #999999;text-align: center;padding: 32px;font-size: 16px;background: #fff;"
             v-if="!list ||list.length<=0">
            暂无工作报告
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>

<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            userId: getUrlParamObj().userId,
            checkMore: 'gengduo',
            list: [],
            returnFlag: false,
            isSend: true,
        },
        methods: {
            checkMore1: function () {
                var that = this
                if (that.checkMore == 'shouqi') {
                    that.checkMore = 'gengduo'
                } else {
                    that.checkMore = 'shouqi'
                }
            },
            formatDate: function (now) {
                if (now) {
                    return new Date(now).Format(TimeFormat.middle)
                }

            },
            formatDate2: function (now) {
                if (now) {
                    return new Date(now).Format(TimeFormat.pcListYR)
                }

            },

            getPingJiaList: function (item) {
                var that = this
                $.wyui.postMethod('/wreport/getPingjiaList.json', {
                    'reportDate': item.reportDate,
                    'sendUserId': item.userId
                }, function (r) {
                    //查看是当前的报告评价
                    if (r.todayList && r.todayList.length > 0) {
                        item.commentList = r.todayList
                    } else {
                        item.commentList = []
                    }

                })
            },
            spliceString: function (evaluation, otherDescription) {
                if (evaluation && evaluation != '') {
                    if (evaluation.indexOf("|") != -1) {
                        return evaluation.replace(/\|/gi, ";") + ";" + otherDescription
                    } else {
                        if (evaluation && evaluation != "") {
                            return evaluation + ";" + otherDescription
                        } else {
                            return otherDescription
                        }
                    }
                }
            },
            getWorkFlag: function (item) {
                var that = this;
                $.wyui.postMethod(urlConfig.wreport.wreport.getWorkFlag, {
                    userId: getUrlParamObj().userId,
                    reportDate: item.reportDate
                }, function (r) {
                    item.workFlag = r[0].workFlag
                });
            },
            getWReportList: function () {
                var that = this;
                JSBridge.call(UI, 'showLoading', {})
                $.wyui.postMethod("/wreport/getList.json", {
                    "userId": that.userId,
                    "month": new Date().Format('MM'),
                    "year": new Date().Format('yyyy')
                }, function (data) {
                    console.log(data)
                    JSBridge.call(UI, 'hideLoading')
                    for (var i = 0; i < data.length; i++) {
                        data[i].workFlag = '';
                        data[i].commentList = [];
                    }
                    for (var i = 0; i < data.length; i++) {
                        that.getWorkFlag(data[i])
                        that.getPingJiaList(data[i])
                    }
                    that.list = data;
                    that.returnFlag = true;
                    for (var i = 0; i < that.list.length; i++) {
                        var item = that.list[i]
                        if (new Date().Format("yyyy-MM-dd") == item.reportDate) {
                            that.isSend = item.flage == "0"
                        }
                    }
                });
            },
            //打开报告详情
            openDetail: function (id) {
                if (id) {
                    var param = {
                        title: '报告详情',
                        url: '/page/wreport/detailAPP.html?id=' + id,
                    }
                    JSBridge.call(ROUTER, 'navigateTo', param)
                }
            },
        },
        mounted: function () {
            var that = this;
            that.getWReportList();
        }


    })
</script>
</body>
</html>